package cn.jdy.task.entity;

import cn.jdy.common.bo.BaseEntry;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Transient;

@Entity
public class SchedulingJob extends BaseEntry {

	private static final long serialVersionUID = 1L;

	public static final String JS_ENABLED = "0";		//任务启用状态
	public static final String JS_DISABLED = "1";		//任务禁用状态
	public static final String JS_PAUSE = "2";			//任务暂停状态
	public static final String JS_DELETE = "3";			//任务已删除状态

	public static final String OWER_SHOP = "SHOP";			//任务前台
	public static final String OWER_ADMIN = "ADMIN";		//任务后台

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)//根据数据库自动适配 mysql默认自增
	private Long id;			//任务Id
	@Column(nullable = false, length = 50)
	private String jobName;			//任务名称
	@Column(nullable = false, length = 100)
	private String jobGroup;		//任务所属组的名称
	@Column(nullable = false, length = 10)
	private String ower;		    //任务宿主
	@Column(nullable = false, length = 2)
	private String status;		  //任务的状态，0：启用；1：禁用；2：已删除
	@Column(nullable = false, length = 30)
	private String cronExpression;	//定时任务运行时间表达式
	private String description;		//任务描述
	
	private String strParam;		//任务运行时参数
	@Transient
	private String strParam2;		//任务运行时参数，手动调度临时入参

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getOwer() {
		return ower;
	}

	public void setOwer(String ower) {
		this.ower = ower;
	}

	public String getJobName() {
		return jobName;
	}

	public void setJobName(String jobName) {
		this.jobName = jobName;
	}

	public String getJobGroup() {
		return jobGroup;
	}

	public void setJobGroup(String jobGroup) {
		this.jobGroup = jobGroup;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getCronExpression() {
		return cronExpression;
	}

	public void setCronExpression(String cronExpression) {
		this.cronExpression = cronExpression;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getStrParam() {
		return strParam;
	}

	public void setStrParam(String strParam) {
		this.strParam = strParam;
	}

	public String getStrParam2() {
		return strParam2;
	}

	public void setStrParam2(String strParam2) {
		this.strParam2 = strParam2;
	}
	
}
